using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using Microsoft.Xna.Framework.Graphics;

namespace Dracham.TileManagement
{
    public class TextureManager
    {
        private static List<DrachamTexture> textures = new List<DrachamTexture>();

        public static void Initialize(XmlDocument xData)
        {
            foreach (XmlNode texture in xData.GetElementsByTagName("Textures")[0].ChildNodes)
            {
                if (texture.Name == "Texture")
                {
                    textures.Add(DrachamTexture.FromXmlNode(texture));
                }
            }
        }
        
        public static DrachamTexture GetTexture(String name)
        {
            foreach (DrachamTexture dt in textures)
            {
                if (dt.Name == name)
                {
                    return dt;
                }
            }

            return null;
        }
    }
}
